<%-- 
    Document   : VistaAniDefuncion
    Created on : 26-oct-2013, 12:07:18
    Author     : WALDIR
--%>

<%@page import="java.sql.*"%>
<%@page import="com.ptr.controladores.conexionsqlserver"%>
<%@page import="com.ptr.ptrsystem.dao.Lista"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <%
        String codigo = request.getParameter("ref");
        String nroactaP = "";
        String nroactaD = "";
        String FechaR = "";
        String CDeub = "";
        String CPrub = "";
        String CDiub = "";
        String Cotub = "";
        String Nubd = "";
        String Lugar = "";
        String FechaD = "";
        String Hora = "";
        String Nmadre = "";
        String Npadre = "";
        String Ndeclarante = "";
        String nregistrador = "";
        String Nestado = "";
        String Observaciones = "";
        String persona = "";
        String ruta="";
        try {
            conexionsqlserver con = new conexionsqlserver();
            Connection cn = null;
            Statement st = null;
            ResultSet rs = null;
            String QQ = "select * from TB_DEFUNCION d,TB_PERSONA p,TB_UBIGEO ub,TB_CENT_LUG_OCURRE oc where (d.COD_PERSONA=p.COD_PERSONA and d.IDUBIGEO=ub.idubigeo and oc.COD_LUGAR_OCURR=d.COD_LUGAR_OCURR) and d.NRO_ACTA_CDEF='" + codigo + "'";
            con.conectar();
            cn = con.getconection();
            st = cn.createStatement();
            rs = st.executeQuery(QQ);
            if (rs.next()) {
                nroactaP = rs.getString("COD_PERSONA");
                nroactaD = rs.getString("NRO_ACTA_CDEF");
                FechaR = rs.getString("FECHA_REG_DEF");
                CDeub = rs.getString("id_ubigeo_dep");
                CPrub = rs.getString("id_ubigeo_prov");
                CDiub = rs.getString("id_ubigeo_dist");
                Cotub = rs.getString("id_ubigeo_otro");
                Nubd = rs.getString("nom_ubigeo_dep") + " " + rs.getString("nom_ubigeo_prov") + " " + rs.getString("nom_ubigeo_dist") + " " + rs.getString("nom_ubigeo_otro");
                Lugar = rs.getString("NOM_CEN_LUG_OCU");
                FechaD = rs.getString("FECHA_DEF");
                Hora = rs.getString("HORA_DEF");
                Nmadre = Lista.getNombrePersona(rs.getString("DNI_MADRE"));
                Npadre = Lista.getNombrePersona(rs.getString("DNI_PADRE"));
                Ndeclarante = Lista.getNombrePersona(rs.getString("DNI_DECLARANTE"));
                nregistrador = Lista.getNombrePersona(rs.getString("DNI_PERS_REG"));
                Nestado = Lista.getNombreEstado(rs.getString("COD_ESTADO"));
                Observaciones = rs.getString("OBSERVACIONES");
                persona = rs.getString("PRIM_APE_PERS") + " " + rs.getString("SEG_APE_PERS") + " " + rs.getString("PRE_NOM_PERS");
                ruta=rs.getString("RUTA_ACTA_DEF");
            }
        } catch (Exception z) {
            z.printStackTrace();
        }

    %>
    <body style="background-color: #f9f9f9 ">
        <form action="${pageContext.request.contextPath}/ConsultasActasImagen" method="POST">   
            <div>
                <table border="0" align="center" width="80%" style="border: 1px solid">                
                    <tr><td>
                            <table align="center" border="0" style="background-color: #597498">
                                <tr>
                                    <td style="background-color: #597498"><div><label style="font-size: 1.5em; font-weight: bold; color: white">DATOS CDEF</label></div></td>
                                </tr>
                                <tr><td>
                                        <fieldset style="padding-left:20px;border: 1px solid #f1c363;background-color: #fffde7;width: 72em">
                                            <legend style="border: 1px solid #f1c363; background-color: #fffde7; color: #b27244">Datos Personales</legend>
                                            <table border="0" align="center" width="100%">
                                                <tr>
                                                    <td>
                                                        <label/>Nro Acta Personal
                                                    </td>
                                                    <td>
                                                        <input type="text" name="" value="<%=nroactaP%>" style="width: 100px;border: 1px solid #f1c363;background-color: #fdeecd"/>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <label/>CIUDADANO(A)
                                                    </td>
                                                    <td>
                                                        <input type="text" name="" value="<%=persona%>" style="width: 400px;border: 1px solid #f1c363;background-color: #fdeecd"/>
                                                    </td>
                                                    <td>
                                                        <label/>Estado
                                                    </td>
                                                    <td>
                                                        <input type="text" name="" value="<%=Nestado%>" style="width: 100px;border: 1px solid #f1c363;background-color: #fdeecd" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </fieldset>
                                    </td></tr>
                            </table>
                        </td>
                    </tr>
                    <!--Datos de la Persona!-->
                    <tr>            
                        <td>
                            <div>
                                <table align="center" border="0" width="100%">
                                    <tr><td width="70%">
                                            <fieldset style="padding-left:20px;border: 1px solid #5ba0ff;background-color: #f5f9ff;width: 50em">
                                                <legend style="border: 1px solid #5ba0ff; background-color: #f5f9ff; color: #85aabb">Datos CDEF</legend>
                                                <table border="0">
                                                    <tr>
                                                        <td>
                                                            <label/>Nro Acta CDEF
                                                        </td>
                                                        <td>
                                                            <input type="text" name="" value="<%=nroactaD%>" style="width: 100px;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em "/>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <label/>Fecha De Registro CDEF
                                                        </td>
                                                        <td>
                                                            <input type="text" name="FRM" value="<%= FechaR%>" style="width: 110px;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em "/>
                                                        </td>
                                                    </tr>

                                                    <tr>
                                                        <td>
                                                            <label/>Lugar De Ocurrencia
                                                        </td>
                                                        <td>
                                                            <input type="text" name="" value="<%=Lugar%>"  style="width: 200px;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em ">
                                                        </td>

                                                        <td>
                                                            <label/>Fecha De Defuncion
                                                        </td>
                                                        <td>
                                                            <input type="text" name="" value="<%=FechaD%>"  style="width: 110px;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em "/>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <label/>Hora De Defuncion
                                                        </td>
                                                        <td>
                                                            <input type="text" name="" value="<%=Hora%>"  style="width: 50px;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em "/>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </fieldset>
                                            <fieldset style="padding-left:20px;border: 1px solid #5ba0ff;background-color: #f5f9ff;width: 50em">
                                                <legend style="border: 1px solid #5ba0ff; background-color: #f5f9ff; color: #85aabb">Ubigeo CDEF</legend>
                                                <table border="0">
                                                    <tr>
                                                        <td><input type="text" name="depm" id="depm" size="2" value="<%=CDeub%>" style="width: 2.0em;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em " maxlength="2"></td>
                                                        <td><input type="text" name="provm" id="prom" size="2" value="<%=CPrub%>"  style="width: 2.0em;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em " maxlength="2"></td>
                                                        <td><input type="text" name="distm" id="dism" size="2" value="<%=CDiub%>"  style="width: 2.0em;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em " maxlength="2"></td>
                                                        <td><input type="text" name="otrom" id="otrm" size="2" value="<%=Cotub%>"  style="width: 2.0em;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em " maxlength="2"></td>
                                                        <td><input type="text" name="lugar_m" id="nombreubigeoM" value="<%=Nubd%>"  style="width: 45.0em;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em ">
                                                        </td>
                                                    </tr>
                                                </table>
                                            </fieldset>
                                        </td>
                                        <td  rowspan="4">
                                            <fieldset style="border: 1px solid #5ba0ff;background-color: #f5f9ff;width: 20em">
                                                <legend style="border: 1px solid #5ba0ff; background-color: #f5f9ff; color: #85aabb">IMAGEN ACTA</legend>
                                                <table border="0" align="center" width="10%">
                                                    <tr>
                                                        <td><%%>
                                                            <object width="300px" height="400em">
                                                                <embed src="<%=ruta %>" width="300px" height="400em" alt="">
                                                            </object>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </fieldset>

                                        </td>                        
                                    </tr>
                                    <tr>
                                        <td>
                                            <fieldset style="padding-left:20px;border: 1px solid #5ba0ff;background-color: #f5f9ff;width: 50em">
                                                <legend style="border: 1px solid #5ba0ff; background-color: #f5f9ff; color: #85aabb">Otros Datos</legend>
                                                <table border="0">
                                                    <tr>
                                                        <td>
                                                            <label/>Nombre Madre
                                                        </td>
                                                        <td>
                                                            <input type="text" name="" value="<%=Nmadre%>"  style="width: 400px;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em ">
                                                        </td>
                                                    </tr><tr>
                                                        <td>
                                                            <label/>Nombre Padre
                                                        </td>
                                                        <td>
                                                            <input type="text" name="" value="<%=Npadre%>"  style="width: 400px;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em "/>
                                                        </td>
                                                        <td width="20%" colspan="2" align="right" >
                                                            <button type="submit" name="btn1" value="BDatosNAc"style='width:10.0em; heigth:8em; background-color: #eeeeee;border: 1px solid #9cafff;border-radius: 7px 7px 7px 7px;'  disabled="true"><img src='/RegCivil/imagenes/find.png'>Buscar</button>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <label/>Nombre Declarante
                                                        </td>
                                                        <td>
                                                            <input type="text" name="NT1" value="<%=Ndeclarante%>" style="width: 400px;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em " />
                                                        </td>
                                                        <td></td>
                                                        <td width="20%" colspan="2" align="right"  >
                                                            <button type="reset" style='width:10.0em; heigth:8em; background-color: #eeeeee;border: 1px solid #9cafff;border-radius: 7px 7px 7px 7px;' disabled="true" ><img src='/RegCivil/imagenes/note_edit.png'>Limpiar</button>
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td>
                                                            <label/>Nombre Registrador
                                                        </td>
                                                        <td>
                                                            <input type="text" name="" value="<%=nregistrador%>" style="width: 400px;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em "/>
                                                        </td>
                                                        <td width="20%" colspan="2" align="right" >
                                                            <button type=button onclick="JavaScript:location.href = '/RegCivil/jsp/BDefuncion.jsp';" style='width:10.0em; heigth:8em; background-color: #eeeeee;border: 1px solid #9cafff;border-radius: 7px 7px 7px 7px;'><img src='/RegCivil/imagenes/return.png'>Retornar</button>
                                                        </td>
                                                    </tr>
                                                </table>
                                            </fieldset>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <fieldset style="padding-left:20px;border: 1px solid #5ba0ff;background-color: #f5f9ff;width: 50em">
                                                <legend style="border: 1px solid #5ba0ff; background-color: #f5f9ff; color: #85aabb">Observaciones</legend>
                                                <table>
                                                    <tr>
                                                        <td>
                                                            <label/>Observaciones
                                                        </td>
                                                        <td>
                                                            <input type="text" name="" value="<%=Observaciones%>" style="width: 420px;border: 1px solid #5ba0ff;background-color: #f9f9f9;height: 2em " />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </fieldset>
                                        </td>
                                    </tr>
                                </table>
                        </td>
                    </tr>
                </table>
            </div>
        </form>
    </body>
</html>
